<?php
$con = mysql_connect("localhost","root","666666");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
else 
{
	echo "OK";
}

// 一些代码...

mysql_close($con);
?>